namespace Xmef.Engine.Internal
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using Xmef.Interfaces;
    using Xmef.Library;

    [Serializable]
    internal class PluginObjectCollection<T> : GenericCollection<IPluginObject<T>>, IPluginObjectCollection<T>, IPluginObjectActivator<T>, IPluginObjectActivator, IGenericCollection<IPluginObject<T>>, IContainer<IPluginObject<T>>, IEnumerable<IPluginObject<T>>, IEnumerable
    {
        public void ProcessObject(Action<T> action)
        {
            foreach (IPluginObject<T> item in base.List)
            {
                item.ProcessObject(action);
            }
        }
        public bool ProcessObject(Predicate<T> match)
        {
            foreach (IPluginObject<T> item in base.List)
            {
                item.ProcessObject(match);
            }
            return true;
        }
        public void ProcessService(Action<Type> action)
        {
            foreach (IPluginObject<T> item in base.List)
            {
                item.ProcessService(action);
            }
        }
        public bool ProcessService(Predicate<Type> match)
        {
            foreach (IPluginObject<T> item in base.List)
            {
                item.ProcessService(match);
            }
            return true;
        }
    }
}

